import { S } from '../../../s';
import { IPSDEFVRGroupCondition } from './ipsdefvrgroup-condition';
import { IPSDEFValueRule } from './ipsdefvalue-rule';
import { IPSSysPFPlugin } from '../../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../../psmodel-object-impl';

export class PSDEFValueRuleImpl
  extends PSModelObjectImpl
  implements IPSDEFValueRule
{
  get codeName(): string {
    return this.M.codeName;
  }

  protected psdefvrgroupcondition: IPSDEFVRGroupCondition;
  getPSDEFVRGroupCondition(): IPSDEFVRGroupCondition | null {
    return (
      this.psdefvrgroupcondition ||
      (this.psdefvrgroupcondition = this.fillObjectModel(
        S._1c6,
        this.M.getPSDEFVRGroupCondition,
        S._31b,
      ) as IPSDEFVRGroupCondition)
    );
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get ruleInfo(): string {
    return this.M.ruleInfo;
  }

  get ruleTag(): string {
    return this.M.ruleTag;
  }

  get ruleTag2(): string {
    return this.M.ruleTag2;
  }

  get scriptCode(): string {
    return this.M.scriptCode;
  }

  get checkDefault(): boolean {
    return this.M.checkDefault;
  }

  get customCode(): boolean {
    return this.M.customCode != null ? this.M.customCode : false;
  }

  get defaultMode(): boolean {
    return this.M.defaultMode;
  }

  get enableBackend(): boolean {
    return this.M.enableBackend;
  }

  get enableFront(): boolean {
    return this.M.enableFront;
  }
  get cls(): string {
    return 'PSDEFValueRuleImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1d1) return true;
    return super.instanceof(cls);
  }
}
